package cn.secby.orders.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.baomidou.mybatisplus.annotation.*;
import cn.secby.common.core.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import cn.secby.common.core.web.domain.BaseEntity;

/**
 * 订单明细对象 tb_order_item
 * @author shenkunlin
 * @date 2025-05-06
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "tb_order_item")
public class OrderItem extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    @TableId(value ="id" ,type = IdType.ASSIGN_ID )
    @JsonSerialize(using=ToStringSerializer.class)
    private Long id;

    /** 订单ID */
    @Excel(name = "订单ID")
    @TableField(value = "order_id")
    private Long orderId;

    /** 商品规格ID */
    @Excel(name = "商品规格ID")
    @TableField(value = "sku_id")
    private Long skuId;

    /** 购买数量 */
    @Excel(name = "购买数量")
    @TableField(value = "quantity")
    private Long quantity;

    /** 成交价格 */
    @Excel(name = "成交价格")
    @TableField(value = "unit_price")
    private Long unitPrice;

    /** 库存扣减装填 */
    @Excel(name = "库存扣减装填")
    @TableField(value = "lock_status")
    private Integer lockStatus;

}
